Telegram Group & Telegram Channel
To shuffle pandas DataFrame df (in a reproducible way):

df = df.sample(frac=1, random_state=123).reset_index(drop=True)

Alternatively, you can use sklearn.utils.shuffle().

#pandas

@Python_Codes



tg-me.com/python_codes/227
Create:
Last Update:

To shuffle pandas DataFrame df (in a reproducible way):

df = df.sample(frac=1, random_state=123).reset_index(drop=True)

Alternatively, you can use sklearn.utils.shuffle().

#pandas

@Python_Codes

BY Python Codes


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/python_codes/227

View MORE
Open in Telegram


Python Codes Telegram | DID YOU KNOW?

Date: |

The seemingly negative pandemic effects and resource/product shortages are encouraging and allowing organizations to innovate and change.The news of cash-rich organizations getting ready for the post-Covid growth economy is a sign of more than capital spending plans. Cash provides a cushion for risk-taking and a tool for growth.

Python Codes from vn


Telegram Python Codes
FROM USA